export interface CTA {
  label: string;
  href: string;
  style?: "primary" | "secondary" | "link";
  target?: string;
  rel?: string;
}

export interface Media {
  type: "image" | "video";
  src: string;
  alt?: string;
  width?: number;
  height?: number;
}

export interface Hero {
  title: string;
  subtitle?: string;
  description?: string;
  media?: Media;
  ctas?: CTA[];
}

export interface WhatItem {
  title: string;
  desc: string;
  icon?: string;
  metric?: string;
}

export interface HowStep {
  title: string;
  desc: string;
  media?: Media;
}

export interface FeatureItem {
  title: string;
  desc: string;
  metric?: string;
}

export interface FeatureGroup {
  title: string;
  items: FeatureItem[];
}

export interface FAQItem {
  q: string;
  a: string;
}

export interface FooterLink {
  label: string;
  href: string;
}

export interface Footer {
  links?: FooterLink[];
  legal?: FooterLink[];
  contacts?: FooterLink[];
}

export interface SEO {
  title: string;
  description: string;
  keywords?: string[];
  canonical?: string;
  openGraph?: {
    title?: string;
    description?: string;
    image?: string;
  };
  twitter?: {
    card: "summary" | "summary_large_image";
    title?: string;
    description?: string;
    image?: string;
  };
  structuredData?: {
    faq?: FAQItem[];
  };
}

// 添加用于 JSON 数据的宽松类型定义
export interface JsonCTA {
  label: string;
  href: string;
  style?: string;
  target?: string;
  rel?: string;
}

export interface JsonMedia {
  type: string;
  src: string;
  alt?: string;
  width?: number;
  height?: number;
}

export interface JsonSEO {
  title: string;
  description: string;
  keywords?: string[];
  canonical?: string;
  openGraph?: {
    title?: string;
    description?: string;
    image?: string;
  };
  twitter?: {
    card: string;
    title?: string;
    description?: string;
    image?: string;
  };
  structuredData?: {
    faq?: FAQItem[];
  };
}

export interface JsonHero {
  title: string;
  subtitle?: string;
  description?: string;
  media?: JsonMedia;
  ctas?: JsonCTA[];
}

export interface ContentSection {
  title: string;
  content: string;
  items?: {
    title: string;
    description: string;
  }[];
  contact?: {
    email?: string;
    address?: string;
  };
}

export interface LandingData {
  seo: SEO;
  hero: Hero;
  what?: {
    items: WhatItem[];
  };
  how?: {
    steps: HowStep[];
  };
  features?: {
    groups: FeatureGroup[];
  };
  faq?: {
    items: FAQItem[];
  };
  content?: {
    sections: ContentSection[];
  };
  footer?: Footer;
}

// 添加用于 JSON 数据的宽松类型定义
export interface JsonLandingData {
  seo: JsonSEO;
  hero: JsonHero;
  what?: {
    items: WhatItem[];
  };
  how?: {
    steps: Array<{
      title: string;
      desc: string;
      media?: JsonMedia;
    }>;
  };
  features?: {
    groups: FeatureGroup[];
  };
  faq?: {
    items: FAQItem[];
  };
  content?: {
    sections: ContentSection[];
  };
  footer?: Footer;
}
